<!DOCTYPE HTML>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="pt" lang="pt">
<head>
    <meta http-equiv="content-type" content="text/html" charset="utf-8"/>
    <title>Praxis</title>
    
    <link rel="shortcut icon" href="<?php echo base_url()?>public/imagens/favicon.ico" type="image/x-icon" />
    <link rel="stylesheet" href="<?php echo base_url()?>public/css/geral.css"/>
    <link rel="stylesheet" href="<?php echo base_url()?>public/css/cabecalho.css"/>
    <link rel="stylesheet" href="<?php echo base_url()?>public/css/menu.css" />
    <link rel="stylesheet" href="<?php echo base_url()?>public/css/formulario.css" />
    <link rel="stylesheet" href="<?php echo base_url()?>public/css/tabela.css" />
    <link rel="stylesheet" href="<?php echo base_url()?>public/css/botoes.css" />
    <link rel="stylesheet" href="<?php echo base_url()?>public/js/jquery-ui-1.10.3.custom/css/jquery-ui-1.10.3.custom.css" />
        
    <script type="text/javascript" src="<?php echo base_url()?>public/js/jquery-1.10.1.js"> </script>
    <script type="text/javascript" src="<?php echo base_url()?>public/js/jquery-ui-1.10.3.custom/js/jquery-ui-1.10.3.custom.js"> </script>
    <script type="text/javascript" src="<?php echo base_url()?>public/js/jquery.validate.js"> </script>
    <script type="text/javascript" src="<?php echo base_url()?>public/js/jquery.maskedinput-1.3.1.min.js"> </script>
    <script type="text/javascript" src="<?php echo base_url()?>public/js/jquery.tablesorter.js"> </script>
    
    <script>
            function abrePopUp(){
                $('.popUp').fadeIn(600);
                $('.popUpBack').fadeIn(600);
            }
            
            $(document).ready(function(){
               var aval = <?php echo $this->session->userdata('avaliacoes')?>; 
               if(aval > 0){
                   $('.notificacao').html(aval);
               }
            
               $('.listagem').tablesorter();
               $('#pesquisar').keyup(function(e){
                    var encontrou = false;
                    var pula = 0;
                    var termo = $(this).val().toLowerCase();
                    $('.listagem > tbody > tr').each(function(){
                        $(this).find('td').each(function(){
                            if($(this).text().toLowerCase().indexOf(termo) > -1)
                                encontrou = true;
                        });
                        if((!encontrou) && (pula))
                            $(this).hide();
                        else
                            $(this).show();
                        encontrou = false;
                        pula = 1;
                    });
                });
                
                $('.meusDados').click(function(){
                    var id = $(this).attr('id');
                    var divEditar = $('.popUp');
                    $.ajax({
                         url: '<?php echo base_url()?>index.php/pessoa/editarMembro/' + <?php echo $this->session->userdata('pessoa_id')?>,
                         type: 'POST',
                         success: function(data){
                             divEditar.html(data);
                             abrePopUp();
                         }
                    });
                });
                
            });
        </script>
        
<body>
    <div class="popUpBack">
        <div class="popUpContainer">
            <div class="popUp"></div>
        </div>
    </div>
    <div id="cabecalho-wrapper">
        <div id="cabecalho" class="clear wrapper">
            <div id="logo">
                <img src="<?php echo base_url()?>public/imagens/logos/logo.jpg" style="height: 80px; float: left;"/> 
                <p style="font-size:20px;color:grey;position:absolute;top:6px;left:518px;">
                    <br><br><b>Sistema Praxis</b>
                </p>
            </div>
            
            <div id="area-usuario">
                <h2>Olá <?php echo $this->session->userdata('nome')?>!</h2>
                <ul>
                    <li><a class="icone meusDados">Ver Meus Dados</a></li>
                    <li><?php echo anchor('pessoa/logout','Sair', 'class="icone logout"') ?></li>
                </ul>
            </div>
        </div>
    </div>

    <div id="menu-wrapper" class="clear">
        <div id="menu" class="wrapper">
            <ul>
                <li>
                    <div class="notificacao"></div>
                    <?php echo anchor('pessoa/pontosMembro', 'Home'); ?>
                </li>
                <li><?php echo anchor('pessoa/ranking', 'Ranking')?></li>
                <?php if($this->session->userdata('permissao') >= 4){ ?>
                    <li><?php echo anchor('pessoa', 'Membros'); ?></li>
                <?php } ?>
                <li><?php echo anchor('nucleo', 'Núcleos')?></li>
                <li><?php echo anchor('voluntariado', 'Voluntariado')?></li>
                <li><?php echo anchor('cases', 'Cases')?></li>
                <?php if($this->session->userdata('permissao') == 5){ ?>
                    <li><?php echo anchor('falta', 'Faltas')?></li>
                    <li><?php echo anchor('diretoria', 'Diretorias')?></li>
                    <li><?php echo anchor('apoio', 'Apoio')?></li>
                    <li><?php echo anchor('avaliacao', 'Avaliações')?></li>
                <?php } ?>
            </ul>
	</div>
    </div>
    
    <?php if(isset($submenu)){?>
        <div id="submenu-wrapper" class="clear">
            <div id="submenu" class="wrapper">
                <ul>
                    <?php foreach($submenu as $opc){ ?>
                        <li>
                            <?php if($opc['link'] == 'avaliacao/avaliacoesMembroFazer'){?>
                                <div class="notificacao"></div>
                            <?php } ?>
                                <?php echo anchor($opc['link'],$opc['nome'])?>
                        </li>
                    <?php } ?>
                 </ul>
            </div>
        </div>
    <?php } ?>
        
    
    <?php if($this->session->userdata('mensagem')){ ?>
	<div id='mensagem'>
    <?php echo $this->session->userdata('mensagem');
	}
	$this->session->unset_userdata('mensagem');?>
	</div>
    <?php if($this->session->userdata('erro')){ ?>
	<div id='erro'>
    <?php echo $this->session->userdata('erro');
        }
	$this->session->unset_userdata('erro');?>
        </div>

    <div id="principal">
        <div id="conteudo-wrapper">
            <div id="conteudo" class="clear wrapper">
                <div class="interno">
	
                                    
                                    